﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SecureCookie.Implementation.Protocol
{
    /// <summary>
    /// Wraps all the state that should be maintainted between the begin and the end of the request
    /// </summary>
    interface IRequestState
    {
        /// <summary>
        /// Returns true when there was a secured cookie on the request with an expiration
        /// </summary>
        /// <param name="cookieName">The cookie name predicate</param>
        /// <returns>True when an incoming expiration was found for the cookie</returns>
        bool HasExpirationFromIncomingCookie(string cookieName);
        /// <summary>
        /// Returns the expiration when <see cref="HasExpirationFromIncomingCookie"/> has returned True
        /// </summary>
        /// <param name="cookieName">The cookie name predicate</param>
        /// <returns>The expiration of the cookie that was incoming</returns>
        DateTime ExpirationFromIncomingCookie(string cookieName);
        /// <summary>
        /// Registers an incoming expiration for a secured cookie.
        /// </summary>
        /// <param name="dateTime">The expiration datetime</param>
        /// <param name="cookieName">The name of the cookie</param>
        void RegisterExpirationFromIncomingCookie(DateTime dateTime, string cookieName);
    }
}
